#include <iostream>
#include <string>
#include <vector>

void recursion(int left,int right,std::vector<std::string>&res,std::string temp,int n)
{
    if (left == n&&right == n)
    {
        res.push_back(temp);
        return ;
    }

    if (left<n)
    {
        temp.push_back('(');
        recursion(left+1,right,res,temp,n);
    }
    if (right < left&&right<n)
    {
        temp.push_back(')');
        recursion(left,right+1,res,temp,n);
    }
}


int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);

    int n = 0;
    std::cin>>n;

    std::vector<std::string>res;
    recursion(0,0,res,"",n) ;

    for (auto i:res)
    {
        std::cout<<i<<"\n";
    }
    return 0;
}